<?php
if (!defined('ENGINE_NAME')) die ("You can't access this file directly!");

class CErrors
{
	var $aErrors = array();

	/**
	* Error handler
	* @author Bogdan Tkachenko (http://bogus.mail.ua)
	* @param iNum Error number
	* @param sMessage Error message
	* @param sFile Error filename
	* @param iLine Line number
	* @return true
	*/
	function Handler($iNum, $sMessage, $sFile, $iLine)
	{
		global $oTimer;

		array_push	($this->aErrors, array(
						'num'		=> $iNum,
						'message'	=> $sMessage,
						'file'		=> $sFile,
						'line'		=> $iLine,
						'time'		=> $oTimer->stop(4)
						)
					);
					
		return true;
	}

	/**
	* Clear error list
	* @author Bogdan Tkachenko (http://bogus.mail.ua)
	* @return true
	*/
	function Clear()
	{
		$this->aErrors = array();
		return true;
	}

}
